require 'Qt'

module Raklur
	module Ui
		class PostWidget < Qt::Widget
			attr_reader :content
			signals 'contentChanged(string)'

			def initialize account, post, parent=nil
				@content = nil
				super(parent)

				vbox1 = Qt::VBoxLayout.new
				hbox1 = Qt::HBoxLayout.new
				hbox2 = Qt::HBoxLayout.new

				@account = account
				@post = post

				@avatar_lbl = Qt::Label.new 'Avatar', self
				@content_lbl = Qt::Label.new 'Content', self
				@sign_lbl = Qt::Label.new 'Sign', self
				@stamp_lbl = Qt::Label.new 'Stamp', self
				@client_lbl = Qt::Label.new 'Client', self

				vbox1.addWidget @content_lbl

				# hbox2 message info
				hbox2.addWidget @sign_lbl
				hbox2.addWidget @stamp_lbl
				hbox2.addWidget @client_lbl

				vbox1.addLayout hbox2

				hbox1.addWidget @avatar_lbl
				hbox1.addLayout vbox1

				setLayout hbox1

				resize 350, 300
				show
			end

			def content= content
				# FIXME emit signal contentchanged
			end

			def read= val
				# FIXME emit signal read changed
			end
		end
	end
end

if (File.expand_path $0) == (File.expand_path __FILE__) then
	app = Qt::Application.new ARGV
	w = Raklur::Ui::PostWidget.new nil, nil
	app.exec
end
